home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / tclX6.4c / sun4.md / Makefile.save < prev    next >
Encoding:
Makefile  |  1992-12-03  |  5.7 KB  |  162 lines

  1. #
  2. # Makefile --
  3. #
  4. # Makefile for Extended Tcl.  This requires Tcl 6.1 or Tcl 6.2 from Berkeley,
  5. # which should be compiled before running this makefile.  Its location is
  6. # configured below.
  7. #------------------------------------------------------------------------------
  8. # Copyright 1992 Karl Lehenbauer and Mark Diekhans.
  9. #
  10. # Permission to use, copy, modify, and distribute this software and its
  11. # documentation for any purpose and without fee is hereby granted, provided
  12. # that the above copyright notice appear in all copies.  Karl Lehenbauer and
  13. # Mark Diekhans make no representations about the suitability of this
  14. # software for any purpose.  It is provided "as is" without express or
  15. # implied warranty.
  16. #------------------------------------------------------------------------------
  17. # $Id: Makefile,v 1.1 1992/12/02 18:47:19 dglo Exp dglo $
  18. #------------------------------------------------------------------------------
  19. #
  20.  
  21. #include "Config.mk"
  22. #include "config/$(TCL_CONFIG_FILE)"
  23. SHELL=/bin/sh
  24.  
  25. #------------------------------------------------------------------------------
  26.  
  27. # List of files that are touched by secondary makefiles when something changes.
  28.  
  29. MADE.FILES=ucbsrc/made.tmp osSupport/made.tmp src/made.tmp
  30. TKMADE.FILES=tkucbsrc/made.tmp
  31.  
  32. CFLAGS= $(OPTIMIZE_FLAG) $(XCFLAGS) -I$(TCL_UCB_DIR) $(MEM_DEBUG_FLAGS) \
  33.         $(SYS_DEP_FLAGS)
  34.  
  35. #------------------------------------------------------------------------------
  36.  
  37. all: tcl TCLDEFAULT runtcl $(TCL_TK_SHELL)
  38.  
  39.  
  40. #------------------------------------------------------------------------------
  41. # Compile the Extended Tcl library and link the Tcl shell.
  42. #
  43.  
  44. tcl: TCLX_MAKES
  45.  
  46. TCLX_MAKES: libtcl.a
  47.     cd ucbsrc;    $(MAKE) $(MAKEFLAGS) all
  48.     cd osSupport; $(MAKE) $(MAKEFLAGS) all
  49.     cd tclsrc;    $(MAKE) $(MAKEFLAGS) all
  50.     cd src;       $(MAKE) $(MAKEFLAGS) all
  51.  
  52.  
  53. # Copy the UCB libtcl.a file from where it was built.  Force the other
  54. # Makefiles to add their .o files to the library by nuking their made.tmp file.
  55.  
  56. libtcl.a: $(TCL_UCB_DIR)/libtcl.a
  57.     cp $(TCL_UCB_DIR)/libtcl.a .
  58.     rm -f  $(MADE.FILES)
  59.  
  60. #------------------------------------------------------------------------------
  61. # Generate a libtk.a with extensions and a wish shell with Extended Tcl
  62. # commands.
  63. #
  64.  
  65. $(TCL_TK_SHELL): TKX_MAKES runwish
  66.  
  67. TKX_MAKES: libtk.a
  68.     cd tkucbsrc; $(MAKE) $(MAKEFLAGS) all
  69.     cd tksrc;    $(MAKE) $(MAKEFLAGS) all
  70.  
  71.  
  72. # Copy the UCB libtk.a file.  Force the other Makefiles to add their
  73. # .o files to the library by nuking their made.tmp file.
  74.  
  75. libtk.a: $(TCL_TK_DIR)/libtk.a
  76.     cp $(TCL_TK_DIR)/libtk.a libtk.a
  77.     rm -f $(TKMADE.FILES)
  78.  
  79.  
  80. #------------------------------------------------------------------------------
  81. # Generate a temporary TCLDEFAULT file so Tcl can be run in this directory.
  82. # Also generate a script to point the TCLDEFAULT environment variable
  83. # at this file for testing Tcl before its installed.
  84.  
  85. TCLDEFAULT:
  86.     @echo "    -       Generating temporary TCLDEFAULT file.     -"
  87.     @echo "    - Use runtcl script to test Tcl before installing -"
  88.     @echo "    - Use runwish script to test Tk before installing -"
  89.     @echo '# Temporary TCLDEFAULT file for debugging'  >TCLDEFAULT
  90.     @echo "set TCLPATH `pwd`/tcllib"                  >>TCLDEFAULT
  91.     @echo "set TCLINIT `pwd`/tcllib/TclInit.tcl"      >>TCLDEFAULT
  92.  
  93. runtcl:
  94.     @echo ':'                                              >runtcl
  95.     @echo '# script for testing Tcl before installation'  >>runtcl
  96.     @echo "TCLDEFAULT=`pwd`/TCLDEFAULT"                   >>runtcl
  97.     @echo "export TCLDEFAULT"                             >>runtcl
  98.     @echo "if [ \$$# = 0 ]"                               >>runtcl
  99.     @echo "then"                                          >>runtcl
  100.     @echo "    exec `pwd`/tcl"                            >>runtcl
  101.     @echo "else"                                          >>runtcl
  102.     @echo "    exec `pwd`/tcl \"\$$@\""                   >>runtcl
  103.     @echo "fi"                                            >>runtcl
  104.     chmod a+rx runtcl
  105.  
  106. runwish:
  107.     @echo ':'                                              >runwish
  108.     @echo '# script for testing wish before installation' >>runwish
  109.     @echo "TCLDEFAULT=`pwd`/TCLDEFAULT"                   >>runwish
  110.     @echo "export TCLDEFAULT"                             >>runwish
  111.     @echo "if [ \$$# = 0 ]"                               >>runwish
  112.     @echo "then"                                          >>runwish
  113.     @echo "    exec `pwd`/"$(TCL_TK_SHELL)                >>runwish
  114.     @echo "else"                                          >>runwish
  115.     @echo "    exec `pwd`/"$(TCL_TK_SHELL)" \"\$$@\""     >>runwish
  116.     @echo "fi"                                            >>runwish
  117.     chmod a+rx runwish
  118.  
  119. #------------------------------------------------------------------------------
  120. #
  121. #  just test to see if the C++ include file compiles and links
  122.  
  123. tcl++:
  124.     cd src;$(MAKE) $(MAKEFLAGS) TCL++
  125.  
  126. #------------------------------------------------------------------------------
  127. #
  128. # Run the UCB and Extended Tcl tests.
  129.  
  130. test: ucbtests extdtests
  131.  
  132. ucbtests: all
  133.     @echo ""
  134.     @echo "**************************************************"
  135.     @echo "* Ignore failures in tests:  expr-2.2 & expr-2.6 *"
  136.     @echo "**************************************************"
  137.     @echo ""
  138.     ./runtcl -c "cd $(TCL_UCB_DIR)/tests;source all"
  139.  
  140. extdtests: all
  141.     ./runtcl -c "cd tests;source all"    
  142.  
  143. #------------------------------------------------------------------------------
  144. # Install Tcl.
  145.  
  146. install: all
  147.     ./runtcl tclsrc/installTcl.tcl
  148.  
  149.  
  150. #------------------------------------------------------------------------------
  151. # Clean up the mess we made.
  152.  
  153. clean:
  154.     cd ucbsrc;    $(MAKE) $(MAKEFLAGS) clean
  155.     cd osSupport; $(MAKE) $(MAKEFLAGS) clean
  156.     cd src;       $(MAKE) $(MAKEFLAGS) clean
  157.     cd tclsrc;    $(MAKE) $(MAKEFLAGS) clean
  158.     cd tkucbsrc;  $(MAKE) $(MAKEFLAGS) clean
  159.     cd tksrc;     $(MAKE) $(MAKEFLAGS) clean
  160.     -rm -f libtcl.a TCLDEFAULT libtk.a runtcl runwish
  161.